from redis import StrictRedis


# 配置信息
class Config(object):
    # 添加数据库配置
    SQLALCHEMY_DATABASE_URI = "mysql://root:123456@127.0.0.1:3306/information"
    SQLALCHEMY_TRACK_MODIFICATIONS = False
    # session配置
    REDIS_HOST = "127.0.0.1"
    REDIS_PORT = 6379
    SECRET_KEY = "EjpNVSNQTyGi1VvWECj9TvC/+kq3oujee2kTfQUs8yCM6xX9Yjq52v54g+HVoknA"
    # session 的保存地方
    SESSION_TYPE = "redis"
    # 开启Session签名,让 cookie 中的 session_id 被加密签名处理
    SESSION_USE_SIGNER = True
    SESSION_REDIS = StrictRedis(REDIS_HOST, REDIS_PORT)
    PERMANENT_SESSION_LIFETIME = 86400


# 开发环境配置
class DevelopmentConfig(Config):
    DEBUG = True


# 生产环境配置
class ProductionConfig(Config):
    pass


config = {
    "development":DevelopmentConfig,
    "production":ProductionConfig,
    "config":Config
}
